<template>
	<view>
		<view class="wrap">
			<text class="name"><span style="position: relative;">{{ item.teacher_name == null ? '智慧教育老师' : item.teacher_name }}<span
					 class="tags green" v-if="item.teacher_name">高级教师</span></span></text>
			<text class="tag">{{ item.tags == null ? '暂无标签' : item.tags | tagFilter }}</text>
			<text class="personality">{{ item.desc == null ? '暂无简介' : item.desc | descFilter }}</text>
			<!-- <text class="name"><span style="position: relative;">{{ item.teacher_name }}<span class="tags green" v-if="item.teacher_name">高级教师</span></span></text>
			<text class="tag">{{ item.tags | tagFilter }}</text>
			<text class="personality">{{ item.desc | descFilter }}</text> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: {
			item: Object
		},
		methods: {
			// navTo(lesson_id){
			// 	uni.navigateTo({
			// 		url: 'lesson-detail?lid='+lesson_id
			// 	})
			// }
		},
		filters: {
			tagFilter(tags) {
				return tags && tags.replace(/,/g, ' | ')
			},
			descFilter(desc) {
				return desc
			}
		}
	}
</script>

<style scoped>
	.wrap {
		padding: 30upx;
		display: flex;
		flex-direction: column;
		text-align: center;
		background: #fff;
	}

	.name {
		color: #333;
		font-size: 36upx;
		font-weight: bold;
		position: relative;
	}

	.tag {
		color: #666;
		font-size: 28upx;
	}

	.personality {
		color: #333;
		font-size: 24upx;
	}

	.tags {
		width: 100upx;
		height: 28upx;
		background: linear-gradient(95deg, rgba(104, 229, 131, 1) 0%, rgba(38, 201, 157, 1) 100%);
		text-align: center;
		line-height: initial;
		padding: 4upx;
		top: 8upx;
		border-radius: 20upx 20upx 20upx 0;
		font-size: 20upx;
		color: #FFF;
		position: absolute;
		margin-left: 10upx;
	}
</style>
